#include <iostream>
using namespace std;
struct Person{
    int no;
    int age;
    int height;
};
void sort(Person * array, int n){
    if(array == NULL || n<=0)   cout << "error";
    for(int i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(array[j].no-array[i].no<0)
            {
                Person* p = new Person;
                *p = array[j];
                array[j]=array[i];
                array[i]=*p;
                delete p;
            }
            if(array[j].no==array[i].no)
            {
                if(array[j].age-array[i].age<0)
                {
                    Person* p1 = new Person;
                    *p1 = array[j];
                    array[j]=array[i];
                    array[i]=*p1;
                    delete p1;
                }
                if(array[j].age==array[i].age)
                {
                    if(array[j].height-array[i].height<0)
                    {
                        Person* p2 = new Person;
                        *p2 = array[j];
                        array[j]=array[i];
                        array[i]=*p2;
                        delete p2;
                    }
                }
            }
        }
    }
}